1. Field of the Invention
The invention relates to data processing systems and more particularly to a method and apparatus for protecting intersubsystem calls and returns that cross subsystem boundaries.
2. Description of the Related Art
As microprocessors become faster, the traffic between the microprocessor chip and off-chip main memory increases causing a performance bottleneck. As described in U.S. Pat. No. 4, 811,208 entitled "Stack Frame Cache on a Microprocessor Chip" this bottleneck has been lessened by using a local on-chip memory (called a cache) to store frequently used memory data. If data required by the processor is in the cache, an off-chip memory reference is avoided since the data can be fetched directly from the cache. Further reductions in memory traffic are achieved because the cache design is expanded to include instruction fetches. Information relating to call and return instructions is available locally on the chip, so most call and return instructions execute without references to the off-chip memory. The resulting decreased memory bus traffic also reduces the probability that a load or store instruction will have to wait for the memory bus.
A plurality of global registers are provided on the microprocessor chip. One of the global registers is a frame pointer register containing the current frame pointer. The remainder of the global registers are available to a current process as general registers. A stack frame cache mechanism is provided comprised of a register set pool made up of a plurality of register sets, each register set being comprised of a number of local registers on the chip. When a call instruction is decoded, a register set from the register set pool is allocated to the called procedure, and the frame pointer register is initialized. When a return instruction is decoded, the register set is freed for allocation to another procedure called by a subsequent call instruction. If the register set pool is depleted, the contents of a register set associated with a previous (the least recent) procedure are saved in the main memory, and that register set is allocated to the current procedure. The local registers of a register set associated with a procedure contain linkage information including a pointer to the previous frame and an instruction pointer, thus enabling most call and return instructions to execute without needing any references to off-chip memory. This significantly reduces the saving and restoring of registers that must be done when crossing subroutine boundaries. Since the local register sets are mapped into the stack flames, the linkage information that normally appears in stack flames (e.g., pointer to previous frame, saved instruction pointer) is contained in the local registers. This means that most call and return instructions execute without causing any references to off-chip memory.
During intersubsystem calls and returns, it is required that the local registers saved onto the on-chip local register cache or stack by one subsystem should not be accessible to another subsystem. If there is no protection mechanism, then the data "pushed" onto the local register stack-frame cache during a subsystem call can be "popped" out by the new process.
It is therefore an object of the present invention to provide a method and apparatus for protecting intersubsystem calls and returns that cross subsystem boundaries.